package chapter8;

public class InternalTask implements Runnable {
    private final RunnableQueue runnableQueue;

    private volatile boolean running = true;

    public InternalTask(RunnableQueue runnableQueue) {
        this.runnableQueue = runnableQueue;
    }

    @Override
    public void run() {
        while (running && !Thread.currentThread().isInterrupted()){

//            try {
//                Runnable task = runnableQueue.take();
//                task.run();
//            } catch (InterruptedException e){
//                running = false;
//                e.printStackTrace();
//                break;
//            }

        }
    }

    public void stop(){
        this.running = false;
    }
}
